package com.vnaloha.util;

import org.springframework.security.authentication.encoding.ShaPasswordEncoder;

public class EncryptUtil {
	
	/**
	 * Encrypt password by sha1 and salt data
	 * @param password this is real password in plan text
	 * @param salt salt data in plan text
	 * @return password had encrypted
	 */
	public static String encryptSHA1(String password, String salt) {
		ShaPasswordEncoder encoder = new ShaPasswordEncoder();
		String encodedPassword =  encoder.encodePassword(password, salt);
		return encodedPassword;
	}
}
